<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>系统后台 - {$Think.config.INTENDANT_NAME} - by HemaCMS</title>
    <link href="__INTENDANT__/css/admin_style.css" rel="stylesheet" />
    <script src="__COMMON__/jquery.js"></script>
    <script src="__COMMON__/jquery.cookie.js"></script>
    <script src="__COMMON__/layer/layer.js"></script>
    <script src="__COMMON__/datePicker/datePicker.js"></script><!--时间插件-->
    <link href="__COMMON__/datePicker/style.css" rel="stylesheet" /> <!--时间插件CSS-->
    <script src="__INTENDANT__/js/iteny.intendant.js"></script><!--公共easyuiJS -->
    <link href="__INTENDANT__/css/iteny.css" rel="stylesheet" />
</head>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
    <div class="nav">
  	    <ul class="cc">
  	        <li class="current"><a href="{:U('Site/operateLog')}">后台操作日志</a></li>
  	        <li><a class="J_ajax_del" href="{:U('Site/delOperateLog')}">删除一个月前的操作日志</a></li>
  	    </ul>
    </div>
    <div class="table_list">
      <div class="h_a">搜索</div>
      <form method="get" action="{:U('operateLog')}">
        <div class="search_type cc mb10">
          <div class="mb10"> <span class="mr20">
          搜索类型：
          <select class="select_2" name="status" style="width:70px;">
              <option value='' <if condition="$_GET['status'] eq ''">selected</if>>不限</option>
                      <option style="color:red" value="0" <if condition="$_GET['status'] eq '0'">selected</if>>失败</option>
                      <option style="color:green" value="1" <if condition="$_GET['status'] eq '1'">selected</if>>成功</option>
            </select>
            用户名：<input type="text" class="input length_2" name="username" size='10' value="{$_GET.username}" placeholder="用户名">
            IP：<input type="text" class="input length_2" name="ip" size='20' value="{$_GET.ip}" placeholder="IP">
            时间：
            <input type="text" name="start_time" class="input length_2 J_date" value="{$_GET.start_time}" style="width:80px;">
            -
            <input type="text" class="input length_2 J_date" name="end_time" value="{$_GET.end_time}" style="width:80px;">
            <button class="btn">搜索</button>
            </span> </div>
        </div>
      </form>
    </div>
    <div class="table_list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <td align="center" width="30">ID</td>
            <td align="center" width="80" >操作用户</td>
            <td align="center" width="40" >状态</td>
            <td align="left" width="260">操作说明</td>
            <td align="center" width="260">请求路径</td>
            <td width="160">浏览器信息</td>
            <td align="center" width="80">所在地区</td>
            <td align="center" width="80">时间</td>
            <td align="center" width="80">IP</td>
          </tr>
        </thead>
        <tbody>
          <volist name="logslist" id="vo">
            <tr>
              <td align="center">{$vo.id}</td>
              <td align="center">{$vo.username}</td>
              <td align="center"><if condition="$vo['status'] eq 1"><span class="greens">成功</span><else /><span class="reds">失败</span></if></td>
              <td>{$vo.info}</td>
              <td align="center">{$vo.get}</td>
              <td>{$vo.useragent}</td>
              <td align="center">{$vo.country}</td>
              <td align="center">{$vo.time|date="Y-m-d H:i:s",###}</td>
              <td align="center">{$vo.ip}</td>
            </tr>
          </volist>
        </tbody>
      </table>
      <div class="p10">
        <div class="pages"> {$page} </div>
      </div>
    </div>
</div>
<script type="text/javascript">
 //日期选择器
    var dateInput = $("input.J_date")
    if (dateInput.length) {

            dateInput.datePicker();

    }

    //日期+时间选择器
    var dateTimeInput = $("input.J_datetime");
    if (dateTimeInput.length) {

            dateTimeInput.datePicker({
                time: true
            });

    }
$(function(){
  $('.J_ajax_del').on('click', function (e) {
    e.preventDefault();
    // var title = $(this).attr('data');
    var href = $(this).attr('href');
    // alert(title);
    layer.confirm('是否删除上月操作日志', {icon: 3,offset:'200px', title:'删除日志提示'}, function(index){
        layer.close(index);
        $.ajax({
        type: 'post',
        url: href,
        dataType:"json",
        beforeSend: function(){
          layer.load(1);
        },
        success: function(data){
          layer.close(layer.load(1));
          if(!data.status){
            ITENY.alert('提示信息',data.info,2,'3000');

          } else {
            ITENY.alert('提示信息',data.info,1,'3000');
            setTimeout(function(){
                      ITENY.reloadPage(window);
                  },3000);

          }
        },
        error: function(data){
          layer.close(layer.load(1));
          ITENY.alert('提示信息',data.responseText,1,'3000');

        }
      });
    });
  });
});
</script>
</body>
</html>